package java7;

import java.util.*;

public class Q5_2 {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String str;
		Set<String> words=new TreeSet<String>();
		while(in.hasNext()) {
			str = in.next();
			if(str.equals("!!!!!")) {
				break;
			}
			else {
				words.add(str);
			}
		}
		System.out.println(words.size());
		Iterator<String> iter = words.iterator();
	    for (int i = 1; i <= 10 && iter.hasNext(); i++) {
	    	System.out.println(iter.next());
	    }
	    in.close();	
	}

}

